<template>
  <!--  <template>-->
  <RouterView />
  <!--  </template>-->
  <!--  <Loading v-else class="loading" />-->
</template>

<script setup lang="ts">
// import { ref } from 'vue'
import { RouterView } from 'vue-router'
import { useUserStore } from '@/stores/user'
import { useGameStore } from '@/stores/game'
import usePostMessage from '@/utils/postMessage'
// import { Loading } from 'vant'

// const isShow = ref(false)

const userStore = useUserStore()

const gameStore = useGameStore()

const login = async () => {
  try {
    await userStore.login()
    void gameStore.getGameList()
  } catch {
    /* empty */
  }

  // isShow.value = true
}

login()
usePostMessage()

// userStore.login()
</script>
<style lang="less" scoped>
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
</style>
